package driver;

import java.util.ArrayList;

public class MoveQueue {
	
	private ArrayList< Move > queue;
	
	public MoveQueue() {
		
		queue = new ArrayList<Move>();
	}
	
	// method to get the number of moves on queue
	public int getQueueSize() {
		
		return queue.size();
	}
	
	// method to check if queue is empty
	public boolean isEmpty() {
		
		if( queue.size() == 0 ) {
			
			return true;
		}
		else{
			
			return false;
		}
	}
	
	// method to add a new move to the queue
	public void enqueue( Move add ) {
		
		queue.add( add );
	}
	
	// method to remove the oldest move from the queue
	public Move dequeue() {
		
		if( queue.size() == 0 ) {
			
			return null;
		}
		else {
			
			// removes first move in the queue
			Move nextUp = queue.get( 0 );
			queue.remove( 0 );
			return nextUp;
		}
	}

}
